<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title></title>
<#include "/jspgou_sys/head.html"/>
<script type="text/javascript">
function getTableForm() {
	return document.getElementById('tableForm');
}
function optDelete() {
	if(Pn.checkedCount('ids')<=0) {
		alert("<@s.m 'error.checkRecord'/>");
		return;
	}
	if(!confirm("<@s.m 'global.confirm.delete'/>")) {
		return;
	}
	var f = getTableForm();
	f.action="o_delete.do";
	f.submit();
}

function chgStatus() {
	var status = $("input[name=status]:checked").val();
	location.href="v_list.do?cid=${cid!}&status=" + status;
}
</script>
</head>
<body>
<div class="body-box">
<div class="rhead">
	<div class="rpos"><@s.m "global.position"/>: <@s.m "order.function.all"/> - <@s.m "global.list"/></div>
	<form class="ropt">
	</form>
	<div class="clear"></div>
</div>
<div class="rhead">
	<form action="v_list.do">
	 <div style="padding-top:5px">
	 <label for="productName">商品名称：</label>
      <input id="productName" type="text" style="width:100px" value="${productName!}" name="productName" size="50"/>
      订单编号: <input type="text" name="code" value="${code!}" style="width:100px"/> 
	收货人: <input type="text" name="userName" value="${userName!}" style="width:100px"/>  
	 订单总额:
	 <input type="text" name="startOrderTotal" value="${startOrderTotal!}" style="width:70px"/>
	    &nbsp;至&nbsp;<input type="text" name="endOrderTotal" value="${endOrderTotal!}" style="width:70px"/>
        下单日期:
         <input type="text" name="startTime" value="${startTime!}" class="Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" style="width:100px"/>
	    &nbsp;至&nbsp;<input type="text" name="endTime" value="${endTime!}" class="Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" style="width:100px"/>
       <select name="paymentId">
            <option value="">--支付方式--</option>
         <#list paymentList as payment>
            <option value="${payment.id}"<#if paymentId??> <#if paymentId==payment.id>selected="selected"</#if></#if>>${payment.name!}</option>
         </#list>  
       </select>
       <select name="shoppingId">
            <option value="">--配送方式--</option>
         <#list shippingList as shopping>
            <option value="${shopping.id}"<#if shoppingId??> <#if shoppingId==shopping.id>selected="selected"</#if></#if>>${shopping.name!}</option>
         </#list>  
       </select>
       <select name="source">
            <option value="">--订单来源--</option>
            <option value="0" <#if source??> <#if source==0>selected="selected"</#if></#if>>平台商自营</option>
            <option value="1" <#if source??> <#if source==1>selected="selected"</#if></#if>>第三方店铺订单</option> 
       </select>
       <select name="status">
			<option value="">--订单状态--</option>
			<option value="1" <#if status??&&status=1>selected="selected"</#if>>未确认</option>
			<option value="2" <#if status??&&status=2>selected="selected"</#if>>已确认</option>
			<option value="3" <#if status??&&status=3>selected="selected"</#if>>已取消</option>
			<option value="4" <#if status??&&status=4>selected="selected"</#if>>已完成</option>
		</select>
		<select name="paymentStatus">
			<option value="">--支付状态--</option>
			<option value="1" <#if paymentStatus??&&paymentStatus=1>selected="selected"</#if>>未支付</option>
			<option value="2" <#if paymentStatus??&&paymentStatus=2>selected="selected"</#if>>已支付</option>
			<option value="3" <#if paymentStatus??&&paymentStatus=3>selected="selected"</#if>>已退款</option>
		</select>
		<select name="shippingStatus">
			<option value="">--配送状态--</option>
			<option value="1" <#if shippingStatus??&&shippingStatus=1>selected="selected"</#if>>未发货</option>
			<option value="2" <#if shippingStatus??&&shippingStatus=2>selected="selected"</#if>>已发货</option>
			<option value="3" <#if shippingStatus??&&shippingStatus=3>selected="selected"</#if>>已退货</option>
		</select>
		<select name="isRefunded">
			<option value="">--订单种类--</option>
			<option value="false" <#if isRefunded??&&isRefunded=false>selected="selected"</#if>>普通订单</option>
			<option value="true" <#if isRefunded??&&isRefunded=true>selected="selected"</#if>>预售订单</option>
		</select>
        <input type="hidden" name="type" value="${type!}"/>
        <input type="submit"  value="<@s.m "global.query"/>" />
		</div>
	</form>
	<div class="clear"></div>
</div>
<form id="tableForm" method="post">
<input type="hidden" name="pageNo" value="${pageNo!}"/>
<input type="hidden" name="productName" value="${productName!}"/>
<input type="hidden" name="userName" value="${userName!}"/>
<input type="hidden" name="startOrderTotal" value="${startOrderTotal!}"/>
<input type="hidden" name="endOrderTotal" value="${endOrderTotal!}"/>
<input type="hidden" name="startTime" value="${startTime!}"/>
<input type="hidden" name="endTime" value="${endTime!}"/>
<input type="hidden" name="paymentId" value="${paymentId!}"/>
<input type="hidden" name="shoppingId" value="${shoppingId!}"/>
<input type="hidden" name="source" value="${source!}"/>
<input type="hidden" name="status" value="${status!}"/>
<input type="hidden" name="paymentStatus" value="${paymentStatus!}"/>
<input type="hidden" name="shippingStatus" value="${shippingStatus!}"/>
<input type="hidden" name="isRefunded" value="<#if isRefunded??>${isRefunded?string('true','false')}<#else>${isRefunded!}</#if>"/>
<@p.table value=pagination;order,i,has_next><#rt/>
	<@p.column title="<input type='checkbox' onclick='Pn.checkbox(\"ids\",this.checked)'/>" width="20">
		<input type='checkbox' name='ids' value='${order.id}'/><#t/>
	</@p.column><#t/>
	<@p.column code="order.id">${order.id}</@p.column><#t/>
	<@p.column code="收货人名称">${order.receiveName!}</@p.column><#t/>
	<@p.column code="订单编号">${order.code!}</@p.column><#t/>
	<@p.column code="order.total" align="center">￥${order.total!}<br/>(含运费:${order.freight!0})</@p.column><#t/>
	<@p.column code="order.createTime" style="width:100px;">${order.createTime}</@p.column><#t/>
	<@p.column code="order.shipping"><#if order.shipping??>${order.shipping.name}</#if></@p.column><#t/>
	<@p.column code="order.payment"><#if order.payment??>${order.payment.name!}</#if></@p.column><#t/>
	<@p.column code="订单所属店铺" align="center"><#if order.store??>${order.store.storeExt.shortName!}<#else>店中店自营</#if></@p.column><#t/>
	<@p.column code="自营" align="center"><#if order.store??>否<#else>是</#if></@p.column><#t/>
	<@p.column code="预售订单" align="center"><#if order.refunded>是<#else>否</#if></@p.column><#t/>
	<@p.column code="order.status"><@s.m "order.status.${order.status}"/></@p.column><#t/>
	<@p.column code="order.paymentStatus"><@s.m "order.paymentStatus.${order.paymentStatus}"/></@p.column><#t/>
	<@p.column code="order.shippingStatus"><@s.m "order.shippingStatus.${order.shippingStatus}"/></@p.column><#t/>
	<@p.column code="global.operate" align="center">
		<a href="v_view.do?id=${order.id}&pageNo=${pageNo!}">查看</a> | <#rt/>
		<a href="v_edit.do?id=${order.id}&pageNo=${pageNo!}"><@s.m "global.edit"/></a> | <#rt/>
		<a href="o_delete.do?ids=${order.id}&pageNo=${pageNo!}" onclick="if(!confirm('<@s.m "global.confirm.delete"/>')) {return false;}"><@s.m "global.delete"/></a><#t/>
	</@p.column><#t/>
</@p.table>
<div><input type="button" value="<@s.m "global.delete"/>" onclick="optDelete();"/></div>
</form>
</div>
<#include "/common/alert_message.html"/>
</body>
</html>